package utils

import (
	beego "github.com/beego/beego/v2/server/web"
	"github.com/siddontang/go/log"
)

/**
 *@author:zhengyilong
 *@email:1797344574@qq.com
 *@phone:13479394730
 *@DateTime:2021/12/23 15:27
 **/

func GetRunmode() string {
	conf := beego.AppConfig
	runmode, _ := conf.String("runmode")
	return runmode
}

func IsDevRunmode() bool {
	runmode := GetRunmode()
	if runmode == "dev" {
		return true
	}
	return false
}

func LogInfo(msg interface{}) {
	if IsDevRunmode() {
		log.Info(msg)
	}
}

func LogError(msg interface{}) {
	if IsDevRunmode() {
		log.Error(msg)
	}
}